package rsee.com;
import java.util.LinkedList;

import com.video.h264.GlobalUtil;

import android.app.Activity;
import android.util.Log;

public class ActivityList {
	public ActivityList() {
		if(GlobalUtil.list==null)
		GlobalUtil.list = new LinkedList<Activity>();
	}

	public void put(Activity activity,int actId) {
		if(getActivity(activity)==null){
		GlobalUtil.list.add(activity);
		Log.e("ActivityList", "add Activity:"+activity.getComponentName());
		}
	}
	public void remove(Activity activity)
	{
		GlobalUtil.list.remove(activity);
	}
	public LinkedList<Activity> get() {
		return GlobalUtil.list;
	}	
	public Activity getActivity(Activity activity)
	{
		for(int i=0;i<GlobalUtil.list.size();i++)
		{
			if(GlobalUtil.list.get(i).getComponentName().equals(activity.getComponentName()))
			{
				return GlobalUtil.list.get(i);
			}
		}
		return null;
	}
}
